package domain;

import java.util.Collection;
import java.util.HashSet;

import javax.persistence.Access;
import javax.persistence.AccessType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;


@Entity
@Access(AccessType.PROPERTY)
public class Participant extends Actor {
	
	// Constructors 
	public Participant(){
		super();
		assessment=new HashSet<Assess>();
		registrations=new HashSet<Registration>();
	}
	


	// Attributes -------------------------------------------------------------
	private CreditCard creditCard;
	
	@Valid
	@NotNull
	public CreditCard getCreditCard() {
		return creditCard;
	}

	public void setCreditCard(CreditCard creditCard) {
		this.creditCard = creditCard;
	}
	
	// Relationships ----------------------------------------------------------
	
	private Collection<Assess> assessment;
	private Collection<Registration> registrations;
	
	@NotNull
	@OneToMany(mappedBy = "participant")
	public Collection<Assess> getAssessment(){
		return assessment;
	}
	public void setAssessment(Collection<Assess> assessment){
		this.assessment=assessment;
		
	}
	
	@NotNull
	@OneToMany(mappedBy = "participant")
	public Collection<Registration> getRegistrations(){
		return registrations;
	}
	public void setRegistrations(Collection<Registration> registrations){
		this.registrations=registrations;
	}
}
